#ifndef __I264E_RECONFIG_H__
#define __I264E_RECONFIG_H__

#include <jzm_enc_api_t21.h>


typedef struct i264e_reconfig {
	/* flags used internal */
	int idr_reconfig_cnt;
	int idr_rcfile_config_cnt;
	int p_reconfig_cnt;
	/* param buckup */
	i264e_param_t parambak;
	/* color2gray */
	int enable_c2g;
	int enable_c2g_cfg;
	uint8_t *empty;
	/* param to hwicodec */
	int start_mb_x;
	int start_mb_y;
	/* rcfg crop */
	int enable_crop;
	int mb_width;
	int mb_height;
	int start_mb_x_cfg;
	int start_mb_y_cfg;
	/* rcfg roi */
	int enable_roi;
	c_roi_t roi[8];
	/* denoise */
	i264e_denoise_t denoise;
	/* high referrence skip */
	c_high_skip_t hskip;

	/* rcfg rc */
	struct
	{
		int rc_method;
		int qp;
		int bitrate;
		int qp_min;
		int qp_max;
		int	biaslvl;
        int qp_step;      /* max QP step between frames */
		int	gop_qp_step;	/* max QP step between gop frames */
		bool adaptive_mode;
		bool gop_relation;
		int static_time;
		int max_bitrate;
		int change_pos;
        int quality_level;
		float trigger_level;
		int new_qp_max_thr;
	} rc;
	RC_CFG_S_T21 rcfile;
	/* rcfg fps */
	int i_fps_num;
	int i_fps_den;
	/* rcfg enidr */
	int enable_enidr;
	int gopsizebak;
    /* mb rc */
    int b_enable_mbrc;
    /* change referrence */
    int b_enable_change_ref;
    /* super frame */
    c_superfrm_param_t superfrm_param;
    /* tranform param */
    int i_chroma_qp_offset;
    /* mutex */
	i264e_pthread_mutex_t mutex_rcfg;
    int qpgmode;
} i264e_reconfig_t;

extern int i264e_reconfig_init(i264e_t *h);
extern int i264e_reconfig_deinit(i264e_t *h);
extern int i264e_idr_reconfig(i264e_t *h);
extern int i264e_p_reconfig(i264e_t *h);
extern int i264e_reconfig(i264e_t *h);
extern int i264e_reconfig_color2gray_set(i264e_t *h, const void *p);
extern int i264e_reconfig_color2gray_get(i264e_t *h, void *p);
extern int i264e_reconfig_cut_set(i264e_t *h, const void *p);
extern int i264e_reconfig_cut_get(i264e_t *h, void *p);
extern int i264e_reconfig_roi_set(i264e_t *h, const void *p);
extern int i264e_reconfig_roi_get(i264e_t *h, void *p);
extern int i264e_reconfig_hskip_set(i264e_t *h, const void *param);
extern int i264e_reconfig_hskip_get(i264e_t *h, void *param);
extern int i264e_reconfig_black_enhance_set(i264e_t *h, const void *param);
extern int i264e_mb_rc_get(i264e_t *h, void *param);
extern int i264e_mb_rc_set(i264e_t *h, const void *param);
extern int i264e_change_ref_get(i264e_t *h, void *param);
extern int i264e_change_ref_set(i264e_t *h, const void *param);
extern int i264e_reconfig_rc_set(i264e_t *h, const void *p);
extern int i264e_reconfig_rc_get(i264e_t *h, void *p);
extern int i264e_reconfig_rc_trig_set(i264e_t *h, const void *p);
extern int i264e_reconfig_rc_trig_get(i264e_t *h, void *p);
extern int i264e_reconfig_fps_set(i264e_t *h, const void *p);
extern int i264e_reconfig_fps_get(i264e_t *h, void *p);
extern int i264e_reconfig_enidr_set(i264e_t *h, const void *p);
extern int i264e_reconfig_enidr_get(i264e_t *h, void *p);
extern int i264e_reconfig_gop_set(i264e_t *h, const void *p);
extern int i264e_reconfig_gop_get(i264e_t *h, void *p);
extern int i264e_reconfig_dn_set(i264e_t *h, const void *param);
extern int i264e_reconfig_dn_get(i264e_t *h, void *param);
extern int i264e_super_rc_get(i264e_t *h, void *param);
extern int i264e_super_rc_set(i264e_t *h, const void *param);
extern int i264e_reconfig_trans_get(i264e_t *h, void *param);
extern int i264e_reconfig_trans_set(i264e_t *h, const void *param);
extern int i264e_reconfig_qpgmode_get(i264e_t *h, void *param);
extern int i264e_reconfig_qpgmode_set(i264e_t *h, const void *param);
#endif
